package quq.missq.huanxin;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.easemob.chat.CmdMessageBody;
import com.easemob.chat.EMMessage;

/**
 * Created by River on 9/22/15.
 */
public class CMDMessageReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        //获取cmd message对象
        String msgId = intent.getStringExtra("msgid");
        EMMessage message = intent.getParcelableExtra("message");
        //获取消息body
        CmdMessageBody cmdMsgBody = (CmdMessageBody) message.getBody();
        String aciton = cmdMsgBody.action;//获取自定义action

        Log.e("xxxxxxxxx ", msgId + " " + message.toString() + "   " + cmdMsgBody.toString());

        //获取扩展属性
        //String attr=message.getStringAttribute("a");

    }


}
